<template>
  <div>
    <div v-if="!edit">
      {{ val }}
    </div>
    <Field
      v-if="edit"
      v-model="val"
      :required="pvalue.required || false"
      value-text-align="left"
      :readonly="pvalue.readonly"
    />
  </div>
</template>

<script>
  import {Field} from "vant"

  export default {
    name: 'FieldText', components: {Field},
    props: {
      edit: {type: Boolean, defautl: false}
  }, inject: ['value'],
  data: function () {
    return { val: this.value.value || '无' }
  }, computed: {
    pvalue: function () {
      return this.value
    }
  }
}
</script>

<style scoped>

</style>
